#include "assert.h"
#include "split_string.h"
#include "split_string_test.h"

void SplitStringTest::testSplitNormal()
{
    string testWord = "hi,girl,pretty";
    vector<string> oriSplitWord = {"hi", "girl", "pretty"};

    vector<string> splited = split(testWord, ',');

    //检测测试结果和预期结果是否一致 ，若不一致则会退出
    assertEqual(splited, oriSplitWord);

    //若通过检测，则输出测试通过信息
    cout << "testSplitNormal() OK!" << endl;
}

void SplitStringTest::testSplitBlank()
{
    string testWord = "";
    vector<string> oriSplitWord;

    vector<string> splited = split(testWord, ',');

    assertEqual(splited, oriSplitWord);

    cout << "testSplitBlank() OK!" << endl;
}
